<?php

class CondenaDB extends CI_Model {

    var $title = '';
    var $content = '';
    var $date = '';

    function __construct() {
        // Call the Model constructor
        parent::__construct();
    }

    function get_last_ten_entries() {
        $query = $this->db->get('entries', 10);
        return $query->result();
    }

    function Insert_Tabl($arrData) {

            $this->db->insert('atrxj', $arrData);

        
    }  
       
    function borrar_tablacondena($item) {
        /*$this->db->where('ficha', $item['eliminar']);
        $this->db->delete('empleado');      */ 
        
        
        $q = $this->db->get_where('atrxj', array('nro_caso' => $item['eliminar']));
            if ($q->result()) {
            $this->db->where('nro_caso',$item['eliminar']);
            $this->db->delete('atrxj');
            return TRUE;
            } else { 
            return FALSE;
            }
    }
    
    
    
    
    
    function update_entrycon($arrData) {
        
        $this->db->where('nro_caso', $arrData['nro_caso']);
        $q = $this->db->get('atrxj');

        if ($q->num_rows() > 0) {
            $this->db->where('nro_caso', $arrData['nro_caso']);
            $this->db->update('atrxj', $arrData);
            return TRUE;
        }else FALSE;
    }

}
